package com.appkubes.mall.admin.application.user.account.history.controller;

import com.appkubes.cloud.config.params.paramValid.ParamValid;
import com.appkubes.common.Response;
import com.appkubes.mall.admin.application.user.account.history.dao.UserAccountHistoryDao;
import com.appkubes.mall.admin.application.user.account.history.entity.dto.UserAccountHistoryInfoDTO;
import com.appkubes.mall.admin.application.user.account.history.entity.vo.UserAccountHistoryVO;
import com.appkubes.mall.core.controller.BaseMallUserAccountHistoryController;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "用户账户收益明细(UserAccountHistoryController)")
@RestController
@RequestMapping("/user/account/history")
public class UserAccountHistoryController extends BaseMallUserAccountHistoryController {

    @Resource
    UserAccountHistoryDao userAccountHistoryDao;

    /**
     * 获取用户的收益信息表, 用于后台->运营管理->经纪人收益明细
     *
     * @param accountHistoryVO
     * @return
     */
    @ApiOperation("获取收益列表")
    @PostMapping("/getHistoryInfo")
    public Response getHistoryInfo(@ParamValid UserAccountHistoryVO accountHistoryVO) {
        IPage<UserAccountHistoryInfoDTO> page = new Page<>(accountHistoryVO.getPage(), accountHistoryVO.getSize());
        IPage<UserAccountHistoryInfoDTO> result = userAccountHistoryDao.getAccountHistoryInfo(page, accountHistoryVO);
        return Response.success(result);
    }




}
